import request from '../../../utils/request';

//查询所有角色
export const getRoles = query => {
    return request({
        url: '/api/upp/role/doMain',
        method: 'post',
        // url: './json/rolelist.json',
        // method: 'get',
        params: query
    });
};
//根据roleId 判断该角色是否已存在
export const isNotExists = query => {
    return request({
        url: '/api/upp/role/isNotexists',
        method:'post',
        // url:'./json/isNotExists.json',
        // method: 'get',
        params: query
    });
};
//添加角色信息
export const doAdd = query => {
    return request({
        url: '/api/upp/role/doAdd',
        method: 'post',
        // url: './json/addORupdatepatient.json',
        // method: 'get',
        params: query,
    });
};
//修改角色
export const doUpdate = query => {
    return request({
        url: '/api/upp/role/doUpdate',
        method:'post',
        // url:'./json/addORupdatepatient.json',
        // method: 'get',
        params: query
    });
};
//删除角色
export const doDelete = query => {
    return request({
        url: '/api/upp/role/doDelete',
        method:'delete',
        // url:'./json/addORupdatepatient.json',
        // method: 'get',
        params: query
    });
};

//根据角色id查询全部的菜单id
export const selectByRoleId = query => {
    return request({
        url: '/api/upp/rolerMenu/selectByRoleId',
        method:'post',
        params: query
    });
};

//新增权限菜单
export const doAddRoleMenu = query => {
    return request({
        url: '/api/upp/rolerMenu/doAdd',
        method:'post',
        params: query
    });
};


